package com.orange.quickback.system.controller.oss.manage;

import com.orange.quickback.system.api.common.result.QBootResult;
import com.orange.quickback.system.service.oss.module.QBootOssService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.security.Principal;


@RestController
@RequestMapping("/admin/")
public class OssController {

    @Resource
    QBootOssService qBootOssService;

    @PostMapping("/uploadFile")
    public QBootResult upload(HttpServletRequest req, @RequestParam("file") MultipartFile[] uploadFiles, Principal pl){
        return qBootOssService.upload(req,uploadFiles,pl);
    }

    @GetMapping("/getAllOssFileByPage")
    public QBootResult getAllOssFileByPage(@RequestParam int page,@RequestParam int size){
        return qBootOssService.getAllOssFileByPage(page,size);
    }
}
